import {addressDefine} from "@/fields/config/AddressConfig";
import {checkboxDefine} from "@/fields/config/CheckboxConfig";
import {dateDefine} from "@/fields/config/DateConfig";
import {idCardDefine} from "@/fields/config/IdCardConfig";
import {inputDefine} from "@/fields/config/InputConfig";
import {nameDefine} from "@/fields/config/NameConfig";
import {phoneDefine} from "@/fields/config/PhoneConfig";
import {radioDefine} from "@/fields/config/RadioConfig";
import {selectDefine} from "@/fields/config/SelectConfig";
import {textareaDefine} from "@/fields/config/TextareaConfig";
import {tabDefine} from "@/fields/config/TabConfig";

export const fieldList = [
  nameDefine,
  phoneDefine,
  idCardDefine,
  inputDefine,
  textareaDefine,
  radioDefine,
  checkboxDefine,
  selectDefine,
  dateDefine,
  addressDefine,
  tabDefine
]


export function buildFieldMap() {
  const dataMap = new Map();
  fieldList.forEach(it => dataMap.set(it.type, it))
  console.log('dataMap', dataMap)
  return dataMap;
}

export const fieldMap = buildFieldMap();
